function ZDCGENDOC(RN,OUTNAME)

local HTML_BEGIN=[[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>ZDC Data</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<style>
		table {	empty-cells: show;border-collapse:collapse;border-spacing:0;}
		TH {background: #f3f3f3;BORDER:1px solid  #dadada;  }
		TD {BORDER:1px solid  #dadada;  }	
	</style>
</head>

<body>
]]
local HTML_END=[[
</body>
</html>
]]
local g=require'zdc.genptodoc'
local usp={}
local _tsp={}
local hitab={}
usp[RN]=true
local flag=true
while flag do
	flag = false
	for k,v in pairs(usp) do
		if type(k)=='string' and type(v)~='string' then
			flag=true
			print('do',k)
			local n=DAL:GetNode(k)
			if n then
				usp[k]=g.gen_one_proto(n,usp,_tsp,hitab)
			else
				usp[k]='not find ' .. k
				print(usp[k])
			end
		end
	end
end
table.sort(usp,zdc.idutil.CmpSub)
local tsp={}
for i,j in pairs(_tsp) do
	tsp[#tsp+1]=i
end
table.sort(tsp,function (a,b)
	local ac=a._class or ''
	local bc=b._class or ''
	if ac==bc then return a.name < b.name end
	return ac<bc
end)
for i,f in ipairs(tsp) do
	tsp[i]=g.gen_one_type(f)
end

local f = io.open(OUTNAME,'wb')
if f then
	f:write(HTML_BEGIN)
	for i,j in ipairs(usp) do
		f:write(usp[j])
	end
	for i,j in ipairs(tsp) do
		f:write(j)
	end
	f:write(HTML_END)	
	f:close()
else
	print(nn)
end

end